package com.order.flowserver.domain.code;

public enum RspCode {

    SUCCESS("成功", "flowserver1"),

    DATA_NOT_EXIST("数据不存在", "flowserver070"),

    DATA_REPEAT("数据重复", "flowserver071"),

    SYS_ERROR("系统异常", "flowserver0");


    private String message;

    private String code;

    RspCode(String message, String code) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static RspCode getEnum(String value) {
        RspCode[] crc = RspCode.values();
        for (int i = 0; i < crc.length; i++) {
            if (crc[i].getCode().equals(value)) {
                return crc[i];
            }
            i++;
        }
        return null;
    }
}
